package com.tuo51.observation.domain;

import com.tuo51.foudation.model.Domain;
import com.tuo51.observation.vo.observation.ObservationRecordChoiceVO;
import com.vladmihalcea.hibernate.type.json.JsonStringType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.List;

@Entity
@Table(name = "ob_record")
@Data
@EqualsAndHashCode(callSuper = true)
@TypeDef(name = "json", typeClass = JsonStringType.class)
public class ObservateRecord extends Domain {

    @Column(columnDefinition = "varchar(32) COMMENT '' ")
    private String staffId;

    @Column(columnDefinition = "varchar(32) COMMENT '' ")
    private String staffName;

    @Column(columnDefinition = "varchar(32) COMMENT '' ")
    private String childrenId;

    @Column(columnDefinition = "varchar(32) COMMENT '' ")
    private String childrenName;

    @Column(columnDefinition = "varchar(32) COMMENT '' ")
    private String dimensionId;

    @Column(columnDefinition = "varchar(50) COMMENT '能区id' ")
    private String title;

    @Column(columnDefinition = "varchar(500) COMMENT '观察内容' ")
    private String observation;



    @Column(columnDefinition = "int default 0 COMMENT '月龄'")
    private Integer month = 0;

    @Type(type = "json")
    @Column(columnDefinition = "JSON COMMENT '选项' ")
    private List<ObservationRecordChoiceVO> result;
}
